home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / isdefined.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  975 b   |  48 lines

  1. <!--- This example shows the use of IsDefined --->
  2.  
  3. <HTML>
  4.  
  5. <HEAD>
  6. <TITLE>
  7. IsDefined Example
  8. </TITLE>
  9. </HEAD>
  10.  
  11. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  12. <BODY  bgcolor="#FFFFD5">
  13.  
  14. <H3>IsDefined Example</H3>
  15.  
  16. <CFIF IsDefined("form.myString")>
  17. <P>Because the variable form.myString has been defined, we
  18. can now show its contents.  This construction allows us
  19. to place a form and its resulting action template in the same
  20. template, while using IsDefined to control the
  21. flow of template execution.
  22. <P>The value of "form.myString" is <B><I><CFOUTPUT>#form.myString#</CFOUTPUT></I></B>
  23.  
  24. <CFELSE>
  25. <P>During the first time through this template, the variable
  26. "form.myString" has not yet been defined, so we 
  27. are not attempting to evaluate it.
  28. </CFIF>
  29.  
  30.  
  31. <FORM ACTION="isdefined.cfm" METHOD="POST">
  32.  
  33. <INPUT TYPE="Text" NAME="MyString" VALUE="My sample value">
  34.  
  35.  
  36. <INPUT TYPE="Submit" NAME="">
  37.  
  38.  
  39. </FORM>
  40.  
  41.  
  42.  
  43. </BODY>
  44.  
  45. </HTML>       
  46.     
  47.    
  48.